<?php 

class Controller extends Smarty{
	//构造函数
	public function __construct()  
	{
		$this->template_dir=MODEL_PATH.'View/'.CONTROLLER.'/';//模板目录
		$this->compile_dir=MODEL_PATH.'View/'.CONTROLLER.'/Compile';//编译目录
		$this->left_delimiter='{hd:';
		is_dir($this->template_dir) or mkdir($this->template_dir,0755,true); 
		is_dir($this->compile_dir) or mkdir($this->compile_dir,0755,true);
		//////////
		if (method_exists($this,'__init')) $this->__init();
	}
	public function success($msg='操作成功',$url=null)
	{
		$this->template_dir=MODEL_PATH.'View/Public/';//模板目录
		$this->compile_dir=MODEL_PATH.'View/Public/Compile';//编译目录
		$this->assign('msg',$msg);
		$this->assign('url',$url);
		$this->display('success.html');
		exit;
	}

	public function error($msg='操作失败',$url=null)
	{
		$this->template_dir=MODEL_PATH.'View/Public/';//模板目录
		$this->compile_dir=MODEL_PATH.'View/Public/Compile';//编译目录
		$this->assign('msg',$msg);
		$this->assign('url',$url);
		$this->display('error.html');
		exit;
	}

}

 ?>